package com.yirui.bridge.config;

/**
 * @author Dujie
 * @create 2025/7/24
 * @since 1.0.0
 */
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void extendHandlerExceptionResolvers(List<HandlerExceptionResolver> resolvers) {
        // 添加到列表开头，确保优先处理
        //resolvers.add(0, new GlobalHandlerExceptionResolver());

        // 或者完全替换现有的解析器
         resolvers.clear();
         resolvers.add(new GlobalHandlerExceptionResolver());
    }
}
